package com.example.lib_net.model.api

/**
 * @author yaotianxue
 * @description
 * @date 2025/1/17
 */
//{"memberId":"1802990914797309953","syPayUserNo":null,"syUserId":"236691","userName":"18630704579","nickName":"摩友293622","cellphone":"18630704579","avatar":{"url":"https://skl-prod.oss-cn-shenzhen.aliyuncs.com/headImg/headImg.png","filename":"","thumbnailUrl":null,"contentLength":0,"contentType":"","imageHeight":0,"imageWidth":0,"firstImage":null},"gender":2,"hobby":null,"giveLikeNumber":0,"commentNumber":0,"releaseNumber":0,"messageNumber":0,"likeNumber":0,"collectNumber":1,"medalImg":null,"modelImg":null,"ifPassword":1,"realName":null,"relation":4,"fansNumber":0,"focusNumber":0,"friendNumber":0,"status":0,"equityName":null}
data class MineModel(
    val memberId:String,
    val syPayUserNo:String?,
    val syUserId:String,
    val userName:String,
    val nickName:String,
    val cellphone:String,
    val avatar:Image,
    val gender:Int,
    val hobby:String?,
    val giveLikeNumber:Int,
    val commentNumber:Int,
    val releaseNumber:Int,
    val messageNumber:Int,
    val likeNumber:Int,
    val medalImg:List<String>?, //勋章图片
    // 2024年01月16日14:30:26 新增
    val fansNumber: Int = 0,   //粉丝数量
    var focusNumber: Int = 0,   //关注数量
    val friendNumber: Int = 0,   //好友数量
    val collectNumber: Int = 0,// 收藏数量
    val mallHistoryNumber: Int = 0,// 足迹数量
){
    fun requireHobby():String{
        if(hobby.isNullOrEmpty()){
            return "未添加签名"
        }
        return hobby
    }
    fun formatFansCount():String{
        return "粉丝 $fansNumber"
    }
    fun formatFriendCount():String{
        return "朋友 $friendNumber"
    }
    fun formatFocusCount():String{
        return "关注 $focusNumber"
    }

    fun requireMessageNumStr():String{
        if(messageNumber <= 99){
            return messageNumber.toString()
        }
        return "99+"
    }

    fun requireLikeNumStr():String{
        if(likeNumber <= 99){
            return likeNumber.toString()
        }
        return "99+"
    }
    fun requireMedalNum():String{
        if(medalImg.isNullOrEmpty()){
            return "0"
        }
        return medalImg.size.toString()
    }

}
//{"url":"https://skl-prod.oss-cn-shenzhen.aliyuncs.com/headImg/headImg.png","filename":"","thumbnailUrl":null,"contentLength":0,"contentType":"","imageHeight":0,"imageWidth":0,"firstImage":null}
data class Image(
    val url:String,
    val filename:String,
    val thumbnailUrl:String?,
    val contentLength:Int,
    val contentType:String,
    val imageHeight:Int,
    val imageWidth:Int,
    val firstImage:String?
)
